package com.gjm.demo.service;

import com.gjm.demo.mapper.MessageMapper;
import com.gjm.demo.model.MessageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageService {

    @Autowired
    private MessageMapper messageMapper;

    //获取所有留言
    public List<MessageInfo> queryAllMessage() {

        return messageMapper.queryAllMessage();
    }

    //添加留言
    public void addMessage(MessageInfo messageInfo) {
        messageMapper.insertMessage(messageInfo);
    }
}
